HTML5 profile attribute

From Microformats Wiki
Jump to navigation Jump to search

The HTML5 profile attribute is a simple way for authors to define URLs and meanings for vocabularies used in an element and its descendants. It is based on and generalizes the HTML4 head element's profile attribute for all elements.

Editors
Tantek Çelik (http://tantek.com/)
Manu Sporny (Bitmunk - Digital Bazaar, Inc.)

copyright and patents statements apply.

Status

HTML5 profile attribute is a work in progress!

Please note that currently several sections are incomplete and are being actively worked on.

This document may be useful for general conceptual review at this point, but nothing more formal.

Public discussion on HTML5 profile attribute takes place on html5-profile-feedback, the #microformats irc channel on irc.freenode.net, and microformats-new mailing list.

Available languages

The English version of this document is the only normative version. For translations of this document see the #translations section.

Errata and Updates

Known errors and issues in this document are corrected in resolved and closed issues. Please check there before reporting issues.

This document is currently under development.

Introduction

HTML4 introduced the profile attribute.

XMDP clarified profile attribute processing, and introduced a profile document format based on XHTML which authors could produce and link to using the HTML4 profile attribute.

microformats have XMDP profiles and recommend linking to them using the profile attribute.

HTML5 has dropped the profile attribute from the head element.

This document is an extension/addition to HTML5 which provides both a more thorough/rigorous definition of the profile attribute and generalizes it to all elements for scoped indication of vocabularies (similar to how the HTML5 microdata document extends and adds to HTML5).

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Format

EDITORS NOTE: filling in formal definition of the profile attribute, processing model.

The profile attribute contains a space separated ordered list of URLs to one or more profile documents.

These profile documents define and provide URLs for vocabulary terms - profile definitions.

These profile definitions apply to the element and its descendants as follows:

  • an element's computed list of profile URLs consists of its profile attribute's ordered list of profile URLs, and if the element has a parent, followed by the parent's computed list of profile URLs.

For backwards compatibility with HTML4, XHTML1, and XHTML1.1:

  • profile URLs specified on a head element in an HTML document are considered to be at the end of the list of profile URLs of the html element, and thus apply to the entire HTML document.

...

Examples

This section is informative.

hCard with scoped profile

<div profile="http://microformats.org/wiki/hcard" class="vcard">
 <a class="url fn" href="http://tantek.com/">Tantek Çelik</a>
</div>

RDFa example

<div profile="http://microformats.org/wiki/hcard#" typeof="vcard">
 <a rel="url" href="http://manu.sporny.org/" property="fn">Manu Sporny</a>
</div>

would generate the following triples:

_:subject0 
   <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
      <http://microformats.org/wiki/hcard#vcard> .
_:subject0 
   <http://microformats.org/wiki/hcard#fn>
      "Manu Sporny" .
_:subject0 
   <http://microformats.org/wiki/hcard#url>
      <http://manu.sporny.org/> .

microdata example

EDITORS NOTE: add a way that microdata could use definitions provided by the profile attribute without having to use full URLs in itemtype attribute values for example.

hybrid example

EDITORS NOTE: add an example using the profile attribute to introduce/define/scope a vocabulary and then use in microdata, microformats, and RDFa markup simultaneously, as a demonstration that they can be used on the same data in a complementary overlapping fashion. not sure of the utility of doing this but demonstrating that they can compatibly be used in the same document or even on the same element may help both alleviate incompatibility concerns, and how to use shared vocabularies across multiple syntaxes.

HTML 4.01 Errata

This section is informative.

EDITORS NOTE: include XMDP interpretations of HTML 4.01 / XHTML 1.0.

The HTML4 recommendation is inconsistent in its description of the profile attribute:

  1. The DTD specifies %URI;, which just expands to CDATA.
  2. On the other hand, the prose explains that This attribute specifies the location of one or more meta data profiles, separated by white space. For future extensions, user agents should consider the value to be a list even though this specification only considers the first URI to be significant. Profiles are discussed below in the section on meta data.

Since the publication of HTML 4.01, a number of meta data profiles have been defined, and many of them can be used in the same document. While the profile attribute does not help in discovering which profile applies to which part of the document, it does allow declaring which profiles are in use, potentially triggering extended behavior in recipients.

This erratum restores consistency in HTML 4.01, explicitly allowing multiple URIs in a single profile attribute.

Corrections to HTML 4.01

Section 6.4 - URIs

REF-URI

After

URIs are represented in the DTD by the parameter entity %URI;.

add

Sets of whitespace-separated URIs are represented by the parameter entity %URIlist;.

Section 7.4.1 - The HEAD element

REF-HEAD

Replace

 
  <tt>profile</tt> = <i>uri</i> [CT]
  

with

 
  <tt>profile</tt> = <i>urilist</i> [CT]
  

(just replacing "uri" by "urilist", but not changing the link target)

Replace

 
  profile     %URI;          #IMPLIED  -- named dictionary of meta info --
  

with

 
  profile     %URIlist;      #IMPLIED  -- list of named meta info dictionaries, whitespace separated --
  

Update the attribute index accordingly.

Replace

This attribute specifies the location of one or more meta data profiles, separated by white space. For future extensions, user agents should consider the value to be a list even though this specification only considers the first URI to be significant. Profiles are discussed below in the section on meta data.

with

This attribute specifies the location of one or more meta data profiles, separated by white space. In case of ambiguities, profiles that appear earlier in the attribute value should be considered more significant. Profiles are discussed below in the section on meta data.

Section 7.4.4 - Meta Data Profiles

REF-PROFILES

Replace

The profile attribute of the HEAD specifies the location of a meta data profile. The value of the profile attribute is a URI. User agents may use this URI in two ways:

with

The profile attribute of the HEAD specifies a set of locations of meta data profiles. The value of the profile attribute is a whitespace-separated list of URIs. User agents may use these URIs in two ways:


Section 21 - Document Type Definition

REF-DTD

Note: the changes below apply both to the copy of the DTD in the HTML 4.01 spec, and the actual DTD files.

After the definition for URI, insert:

 
<!ENTITY % URIlist "CDATA"
    -- whitespace-separated list of Uniform Resource Identifiers,
       see [URI]
    -->
  

Replace the following definition:

 
<!ATTLIST HEAD
  %i18n;                               -- lang, dir --
  profile     %URI;          #IMPLIED  -- named dictionary of meta info --
  >
  

with

 
<!ATTLIST HEAD
  %i18n;                               -- lang, dir --
  profile     %URIlist;      #IMPLIED  -- list of named meta info dictionaries, whitespace separated --
  >
  

profile attribute for other languages

This section is informative.

The profile attribute as defined in this specification can be applied to other markup languages (including previous versions of HTML and XHTML) as follows.

EDITORS NOTE: add informative profile attribute processing model for other languages.

EDITORS NOTE: add examples of HTML4, XHTML1, SVG, and other markup languages that have a class attribute.

EDITORS NOTE: add examples of Atom, and other markup languages that have a rel attribute.

EDITORS NOTE: add note/reference how other markup languages could be extended with both the profile attribute and with one or more of : microformats (by adding class and rel attributes), RDFa (by adding property, rel, and about attributes), and microdata (by adding itemscope, itemtype, itemprop, itemid, and itemref attributes).

Copyright

Per the public domain contribution requirement of the microformats.org wiki, this specification is released into the public domain.

Patents

This specification is subject to a royalty free patent policy, e.g. per the W3C Patent Policy, and IETF RFC3667 & RFC3668.

References

Normative References

Informative References

This section is informative.

Related Pages

Translations

Read the HTML5 profile attribute document in additional languages:

  • none yet